package correct.day19;

import java.util.Scanner;

public class Test3 {
    public static boolean check(boolean[][] hash, int left, int right)
    {
        for(int i = 0; i < 26; i++)
        {
            if(hash[left][i] && hash[right][i])
                return true;
        }
        return false;
    }

    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        while(t-- != 0)
        {
            int n = in.nextInt();
            // hash[i][j] 表⽰第 i 个字符串，j 字符是否出现过
            boolean[][] hash = new boolean[n][26];
            for(int i = 0; i < n; i++)
            {
                char[] s = in.next().toCharArray();
                for(char ch : s)
                {
                    hash[i][ch - 'a'] = true;
                }
            }

            int left = 0, right = n - 1;
            while(left < right)
            {
                if(!check(hash, left, right))
                    break;
                left++;
                right--;
            }

            if(left < right)
                System.out.println("No");
            else
                System.out.println("Yes");
        }
    }
}
